/*  header-comment
/*  file   : /Users/arida/react-hrm-h5/src/components/Image/index
/*  author : arida
/*  date   : 2017-6-4 18:27:23
/*  last   : 2017-7-3 17:57:54
*/
import React from "react";
import PropTypes from "prop-types";
import "./index.less";
/**
 * 图片展示组件（目前仅仅是为了身份认证识别界面使用，后续服用可以考虑重写）
 */
const Image = ({ success, src, direction }) => {
  const leftT = success
    ? <div className="image-sticky"><span className="check-ico">已上传</span></div>
    : <div className="image-sticky">
        <img src="https://gw.alicdn.com/tfs/TB1hiMLbvBNTKJjy0FdXXcPpVXa-210-210.png" className="exp_ico" alt="exp"/>
      </div>;
  return (
    <div className={`renliwo-design-image renliwo-design-image-${direction}`}>
      {leftT}
      <img className="image-backgroud" src={src} />
      <span className="imgInfo">仅限公司办理入职使用</span>
    </div>
  );
};

Image.defaultProps = {
  success: true, // 成功显示对勾
  src: "", // 图片地址，支持base64（好像是废话）
  direction: "horizontal"
};
Image.propTypes = {
  success: PropTypes.bool,
  src: PropTypes.string,
  direction: PropTypes.string
};
module.exports = Image;
